import React from "react";
import {PageHeader, Button, Modal} from 'antd';
export default class Control extends React.Component{
    handleClick(){
        const { confirm } = Modal;
        confirm({

            content:`你确定要重新开始`,
            okText:"确定",
            cancelText:"取消",
            onOk:()=>{
                // console.log('ok');
                this.props.restart()
            },
            onCancel() {
                // console.log('Cancel');
            },
        });
    }
    render(){
        return(
            <div className="site-page-header-ghost-wrapper">
                <PageHeader
                    ghost={false}
                    title="五子棋"
                    subTitle="This is a five-chessboard"
                    extra={[
                        <Button key="2" type="primary" onClick={this.handleClick.bind(this)}>重新开始</Button>,
                        <Button key="1" onClick={()=>this.props.undo()}>
                            悔棋
                        </Button>,
                    ]}
                >

                </PageHeader>
            </div>
        )

    }
}